#!/usr/bin/env python3
# -*- coding: utf-8-

import logging

import pygame
from pygame import display
from pygame import event

class PhysicsObject:
    def __init__(self):
        self.position = [0,0]
        self.velocity = [0,0]
        self.acceleration = [0,0]

        self.size = [0,0]

    @property
    def rect(self):
        return pygame.Rect(*(self.position+self.size))

class UnicornGame:
    def __init__(self):
        self.setup()

        self.loop()

        self.quit()

    def loop(self):
        while self.event_loop():

            #self.screen.blit()
            display.flip()

    def event_loop(self):
        for e in event.get():
            if e.type == pygame.KEYDOWN:
                if e.key == pygame.K_ESCAPE:
                    logging.info('escape')
                    return False

        return True

    def setup(self):
        pygame.init()                                                                           
        self.screen = display.set_mode((300, 300))

    def quit(self):
        pygame.quit()

def main():
    logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
    UnicornGame()

if __name__ == "__main__":
    main()
